home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
jaz_clib.arc
/
JZGETVOL.C
< prev
next >
Wrap
Text File
|
1989-04-09
|
1KB
|
46 lines
/*
┌────────────────────────────────────────────────────────────────────────────┐
│jzgetvol │
│Return the volume label for a specified drive. │
│The drive argument should be 0 for A:,1 for B:, etc. │
│The routine puts the volume name in the string fdest and returns a pointer │
│to fdest. │
│Synopsis: │
│ #define DRIVE_A 0 │
│ char wvol[13]; │
│ jzgetvol(DRIVE_A,wvol); │
│ printf("Your volume label is: ",*wvol ? wvol : <No Volume Id>); │
│ │
│ (C) JazSoft Software by Jack A. Zucker (301) 794-5950 │
└────────────────────────────────────────────────────────────────────────────┘
*/
#include <jaz.h>
#include <jzdirect.h>
char *jzgetvol(fdrive,fdest)
char fdrive;
char *fdest;
{
TDIR wdir;
char fspec[65];
fspec[0] = fdrive+65; /* convert to uppercase letter */
fspec[1] = ':';
fspec[2] = 0;
strcat(fspec,"\\*.*");
#if DEBUG
printf("\n%s\n",fspec);
#endif
if (jzfndfst(fspec,8,&wdir)) {
*fdest = 0;
return(0);
}
strcpy(fdest,wdir.name);
return(fdest);
}